/*
 包含所有 action creator
*/
import {INCREMENT,DECREMENT} from './action-types'
export const addCount = (number)=>({type:INCREMENT,data:number})
export const deCount = (number)=>({type:DECREMENT,data:number})
// 异步action
export const asyncAddCount =(number)=>{
    return dispatch =>{
        // 异步代码
        setTimeout(()=>{
            // 分发一个action
            dispatch(addCount(number))
        },1000)
    }
}
